package com.example.tests;

public class ContactData implements Comparable<ContactData> {
	public String firstname;
	public String lastname;
	public String address1;
	public String mobile;
	public String home;
	public String mobile1;
	public String work;
	public String email;
	public String email2;
	public String day;
	public String mouth;
	public String year;
	public String group;
	public String address2;
	public String home1;

	public ContactData(){
	}
	
	public ContactData(String firstname, String lastname, String address1,
			String mobile, String home, String mobile1, String work,
			String email, String email2, String day, String mouth, String year,
			String group, String address2, String home1) {
		this.firstname = firstname;
		this.lastname = lastname;
		this.address1 = address1;
		this.mobile = mobile;
		this.home = home;
		this.mobile1 = mobile1;
		this.work = work;
		this.email = email;
		this.email2 = email2;
		this.day = day;
		this.mouth = mouth;
		this.year = year;
		this.group = group;
		this.address2 = address2;
		this.home1 = home1;
	}

	
	@Override
	public String toString() {
		return "ContactData [firstname=" + firstname + ", lastname=" + lastname
				+ ", address1=" + address1 + ", mobile=" + mobile + ", home="
				+ home + ", mobile1=" + mobile1 + ", work=" + work + ", email="
				+ email + ", email2=" + email2 + ", day=" + day + ", mouth="
				+ mouth + ", year=" + year + ", group=" + group + ", address2="
				+ address2 + ", home1=" + home1 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstname == null) ? 0 : firstname.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (firstname == null) {
			if (other.firstname != null)
				return false;
		} else if (!firstname.equals(other.firstname))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		return this.firstname.toLowerCase().compareTo(other.firstname.toLowerCase());
	}
	
	
}